OBJS = write1.o write2.o write3.o speed1.o speed2.o speed3.o
CFLAGS = -Wall -ansi -pedantic -g -c
CC = gcc
EXECS = write1 write2 write3 speed1 speed2 speed3

all: $(EXECS)

write1: write1.o
	$(CC) -g -o write1 write1.o
write2: write2.o
	$(CC) -g -o write2 write2.o
write3: write3.o
	$(CC) -g -o write3 write3.o
speed1: speed1.o
	$(CC) -g -o speed1 speed1.o
speed2: speed2.o
	$(CC) -g -o speed2 speed2.o
speed3: speed3.o
	$(CC) -g -o speed3 speed3.o

write1.o: write1.c
	$(CC) $(CFLAGS) write1.c
write2.o: write2.c
	$(CC) $(CFLAGS) write2.c
write3.o: write3.c
	$(CC) $(CFLAGS) write3.c
speed1.o: speed1.c
	$(CC) $(CFLAGS) speed1.c
speed2.o: speed2.c
	$(CC) $(CFLAGS) speed2.c
speed3.o: speed3.c
	$(CC) $(CFLAGS) speed3.c

.PHONY: clean
clean:
	rm -rf $(OBJS)  *.*~ Makefile~ $(EXECS)